//package reader;
//
//import java.io.BufferedReader;
//import java.io.FileReader;
//import java.util.ArrayList;
//import java.util.LinkedList;
//import java.util.List;
//
//import models.state.EnvStateGraph;
//import models.state.State;
//import models.state.Transition;
//
//public class EnvStateTransReader {
//
//	public EnvStateTransReader() {
//		
//	}
//	
//	public EnvStateGraph readEnvStateTransDiagram(String filePath) throws Exception {
//        BufferedReader br = new BufferedReader(new FileReader(filePath));
//        String line;
//        EnvStateGraph graph = new EnvStateGraph();
//        List<State> stateSeg = new LinkedList<State>();
//        List<Transition> transitionSeg = new ArrayList<Transition>();
//        graph.setStates(stateSeg);
//        graph.setTransitions(transitionSeg);
//        if ((line = br.readLine()) != null) {
//        	if(line.equalsIgnoreCase("States:")) {
//        		while(!(line = br.readLine()).equalsIgnoreCase("Transitions:")) {
//        			//read states
//        			String [] idStates = line.trim().split(":");
//        			if(idStates.length != 2) {
//        				br.close();
//        				throw new Exception("Invalid file format exception in "
//        						+ this.getClass().getName() + "#readEnvStateTransDiagram");
//        			}
//        			State state = new State();
//        			state.setId(Integer.parseInt(idStates[0]));
//        			String []states = idStates[1].trim().split("&");
//        			List<String> statesList = new ArrayList<String>();
//        			for(String s : states) {
//        				statesList.add(s);
//        			}
//        			state.setStates(statesList);
//        			stateSeg.add(state);
//        		}
//        		while((line = br.readLine()) != null) {
//        			//read transitions
//        			String []tranAct = line.trim().split(":");
//        			if(tranAct.length != 2) {
//        				br.close();
//        				throw new Exception("Invalid file format exception in "
//        						+ this.getClass().getName() + "#readEnvStateTransDiagram");
//        			}
//        			String []fromTo = tranAct[0].trim().split("-");
//        			Transition t = new Transition();
//        			if(fromTo.length != 2) {
//        				br.close();
//        				throw new Exception("Invalid file format exception in "
//        						+ this.getClass().getName() + "#readEnvStateTransDiagram");
//        			}
//        			t.setFrom(Integer.valueOf(fromTo[0]));
//        			t.setTo(Integer.valueOf(fromTo[1]));
//        			String []actions = tranAct[1].trim().split(";");
//        			List<String> actionList = new ArrayList<String>();
//        			for(String act : actions) {
//        				actionList.add(act);
//        			}
//        			t.setActions(actionList);
//        			transitionSeg.add(t);
//        		}
//        	}
//        }
//        br.close();
//        return graph;
//	}
//}
